package edu.upf.opencities.manager;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import edu.upf.opencities.dao.UserDAO;

import edu.upf.opencities.datamodel.User;

public class UserManagerImpl implements UserManager {

    @Autowired
	private UserDAO userDAO;

	
	@Override
	public boolean registerUser(String userName, String userLastName, String mail,
			boolean isAdmin, String userPassword, String company, String country) {

		return userDAO.registerUser(userName, userLastName, mail, isAdmin, userPassword, company, country);
	}

	@Override
	public boolean updateUser(String userName, String userLastName, String mail,
			boolean isAdmin, String userPassword, String company, String country) {

		return userDAO.updateUser(userName, userLastName, mail, isAdmin, userPassword, company, country);
	}
	
	@Override
	public User getUser(String mail) {
		return userDAO.getUser(mail);
	}

	@Override
	public void deleteUser(String mail, String userPassword) {
		userDAO.deleteUser(mail, userPassword);
	}

	@Override
	public boolean loginUser(String mail, String userPassword) {	
		return userDAO.login(mail, userPassword);
	}

	@Override
	public List<User> getAllUsers() {
		return userDAO.getAllUsers();
	}

}
